home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of MacTutor - S…e Code for Volumes 1 to 5
/
The Best of MacTutor - Source Code for Volume 1-5 (Wayzata Technology)(6031)(1990).bin
/
Source Code
/
#02 (Apr85-Jul85)
/
modula 2
/
modula Vol. 1 #8
/
VolumeTracer.MOD
< prev
Wrap
Text File
|
1985-04-13
|
995b
|
45 lines
IMPLEMENTATION MODULE VolumeTracer;
TYPE
QHdrPtr = POINTER TO QHdr;
QHdr = RECORD
qFlags : INTEGER; (* queue flags *)
qHead : QElemPtr; (* first queue entry *)
qTail : QElemPtr; (* last queue entry *)
END;
VAR
VCBQHdr [0356h] : QHdr; (* VCB queue header *)
PROCEDURE VolumesOnLine(): CARDINAL;
VAR
ptr : QElemPtr;
count : CARDINAL;
BEGIN
ptr := VCBQHdr.qHead;
count := 0;
WHILE ptr # NIL DO
INC(count);
ptr := ptr^.qLink;
END;
RETURN count;
END VolumesOnLine;
PROCEDURE GetVolumeInfo(VAR volume : VCB; whichVol : CARDINAL);
VAR
ptr : QElemPtr;
count : CARDINAL;
BEGIN
ptr := VCBQHdr.qHead;
count := 0;
WHILE (ptr # NIL) AND (count # whichVol) DO
INC(count);
IF count = whichVol THEN
volume := ptr^;
END;
ptr := ptr^.qLink;
END;
END GetVolumeInfo;
END VolumeTracer.